#pragma once
#include <cstring>
#include <array>
#include "IWriter.hpp"


class CClient{
public:
    CClient(IWriter * writer):m_writer(writer){}
    CClient() = delete;
    ~CClient(){}
    CClient(const CClient&) = delete;
    CClient& operator=(const CClient&) = delete;
    CClient(const CClient&&) = delete;
    CClient& operator=(const CClient&&) = delete;

    bool DoProcess(){
        constexpr int BUF_SIZE = 64u;
        std::array<char,BUF_SIZE> buf = {0};
        // memset(buf,'A',64);
        buf.fill('A');
        m_writer->WriteAtBegin(buf.data(),BUF_SIZE);
        // memset(buf,'B',32);
        buf.fill('B');
        m_writer->WriteAt(BUF_SIZE / 4,buf.data(),BUF_SIZE / 2);
        buf.fill('E');
        m_writer->WriteEnd(buf.data(),BUF_SIZE / 2);
        return true;
    }
private:
    IWriter * m_writer;

};